package org.FaPe3D.engine.elements
{
	import flash.filters.GlowFilter;
	import org.papervision3d.materials.utils.MaterialsList;
	import org.papervision3d.objects.parsers.Collada;
	import org.FaPe3D.Adapter;
	import org.papervision3d.view.layer.util.ViewportLayerSortMode;
	import gs.*;

	public class FPCollada extends Collada
	{
		private var _index:int;
		
		public function FPCollada(COLLADA:*, materials:MaterialsList=null, scale:Number=1, doubleSided:Boolean=false, initObject:Object=null)
		{
			super(COLLADA, materials, scale, doubleSided, initObject);
		}
		
		public function get index():int
		{
			return _index;
		}
		
		public function set index(num:int):void
		{
			Adapter.getCurrentAdapter().viewports.getDefaultViewport().containerSprite.sortMode = ViewportLayerSortMode.INDEX_SORT;
			_index = num;
			Adapter.getCurrentAdapter().viewports.getDefaultViewport().getChildLayer(this, true).layerIndex = _index;
			//Adapter.getCurrentAdapter().viewports.getDefaultViewport().getChildLayer(this, true).filters = [new GlowFilter(0x171717, 1, 1, 1, 1, 2)];;
		} 
	}
}